package org.dromara.system.controller.ureport;

import org.dromara.common.core.domain.PageData;
import org.dromara.common.core.domain.R;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.upeport.domain.UreportFileTbl;
import org.dromara.common.upeport.service.IUreportFileTblService;
import org.dromara.common.web.core.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 报表管理Controller
 *
 * @author yanshikui报表管理数据
 * @date 2022-10-07
 */
@RestController
@RequestMapping("/ureportM")
public class UreportFileTblController extends BaseService
{
    @Autowired
    private IUreportFileTblService ureportFileTblService;

    /**
     * 查询报表管理列表
     */
//    @PreAuthorize("@ss.hasPermi('mes:report:list')")


  @GetMapping("/list")
  public PageData list(UreportFileTbl bo, PageQuery pageQuery) {
    return this.resPage(ureportFileTblService.selectUreportFileTblList(bo, pageQuery));
  }

    /**
     * 导出报表管理列表
     */
//    @PreAuthorize("@ss.hasPermi('mes:report:export')")
//    @Log(title = "报表管理", businessType = BusinessType.EXPORT)


    /**
     * 获取报表管理详细信息
     */
//    @PreAuthorize("@ss.hasPermi('mes:report:query')")
    @GetMapping(value = "/{id}")
    public R getInfo(@PathVariable("id") Long id)
    {
        return R.ok(ureportFileTblService.selectUreportFileTblById(id));
    }

    /**
     * 新增报表管理
     */
//    @PreAuthorize("@ss.hasPermi('mes:report:add')")
//    @Log(title = "报表管理", businessType = BusinessType.INSERT)
    @PostMapping
    public R add(@RequestBody UreportFileTbl ureportFileTbl)
    {
        return R.ok(ureportFileTblService.insertUreportFileTbl(ureportFileTbl));
    }

    /**
     * 修改报表管理
     */
//    @PreAuthorize("@ss.hasPermi('mes:report:edit')")
//    @Log(title = "报表管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public R edit(@RequestBody UreportFileTbl ureportFileTbl)
    {
        return R.ok(ureportFileTblService.updateUreportFileTbl(ureportFileTbl));
    }

    /**
     * 删除报表管理
     */
//    @PreAuthorize("@ss.hasPermi('mes:report:remove')")
//    @Log(title = "报表管理", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public R remove(@PathVariable Long[] ids)
    {
        return R.ok(ureportFileTblService.deleteUreportFileTblByIds(ids));
    }
}
